Odd-Even Sort in Powerlists
نویسنده
چکیده
In 6] Misra introduced the powerlist notation and used it to succintly describe several parallel algorithms. In particular, algorithms that use a balanced divide and conquer strategy have elegant descriptions as powerlist functions. Among the examples presented were two sorting networks due to Batcher 1]. To prove their correctness a-posteriori, Misra used the 0-1 principle, which states that a compare-and-swap sorting algorithm is correct ii it sorts all inputs consisting of 0s and 1s. Misra attributed the 0-1 principle to Knuth 3], where Batcher's networks are presented. One of Batcher's networks, the Bitonic Sort, can be derived as a parallel algorithm, as shown by Huang and Lengauer 2]. In this paper we study the odd-even sort which can be considered a parallel version of bubble sort; it is simple to implement and to explain operationally, yet it is ineecient and somewhat tedious to prove correct 0. The algorithm consists of a sequence of phases, where each phase consists of an \even" step followed by an \odd" step. It is often described operationally as follows 5]: At odd steps, we compare the contents of cells 1 and 2, 3 and 4, etc., exchanging values if necessary so that the smaller value ends up in the leftmost cell. At even steps, we perform the same operation for cells 2 and 3, 4 and 5, etc. In this paper we derive the odd-even sort and prove its correctness. In contrast to Batcher's networks, the odd-even sort is iterative in nature and does not have a simple deenition in the powerlist notation. Our derivation is somewhat surprising: from a simple characterization of what it means for a powerlist to be sorted, the algorithm emerges through a series of transformations. The remaining proof of correctness consists of proving that after a nite number of phases of the computation, odd-even sort reaches a xpoint, and that each phase produces a permutation of the input. In contrast to Misra's presentation 6] of Batcher's networks, we derive the odd-even sort, and our proofs of correctness do not use the 0-1 principle. 1 Preliminaries In this paper we use the notation and concepts that exist in the literature on powerlists 0, 4, 6]. As a convenience to the reader we give a brief introduction to the powerlist notation below. A powerlist is a linear data structure, whose elements are all of the same data type. The length of a …
منابع مشابه
Massive Parallelization of Divide-and-Conquer Algorithms over Powerlists
problem adequate structure powerlists We present transformation rules to parallelize Divide-and-Conquer (DC) algorithms over powerlists. These rules convert the parallel control structure of DC into a sequential control flow, thereby making the implicit massive data parallelism in a DC scheme explicit. The results given here are illustrated by many examples including Fast Fourier Transform and ...
متن کاملOn the Average Running Time of Odd-Even Merge Sort
Trus paper is concerned with the average rUDDing time of Batcher's odd-even merge sort when implemented on a collection of processors. We consider the case where n, the size of the input, is an arbitrary multiple of the number p of processors used. We show that Batcher's odd-even merge (for two sorted lists of length n each) can be implemented to run in time O«nlp)(log(2 + p2 In))) on the avera...
متن کاملPerformance Analysis of Odd-even Merge Sort by Using Openmp, Mpi and Concurrent Java
Sorting is a method which arranges the list of elements into a particular order. sorting has two different meanings ordering and categorizing, ordering means to order the list of same items and categorizing means grouping and labeling the same type of items[2]. sorting is used in other algorithms that require sorted list to work efficiently. The odd-even merge sort algorithm was developed by K....
متن کاملParallel System Using a Library of Basic Primitives: Modeling and Experimental Results?
We present a comparative study of implementations of the following sorting algorithms on the Parsytec SC320 reconfigurable, asynchronous, massively parallel MIMD machine: Bitonic Sort, Odd-Even Merge Sort, Odd-Even Merge Sort with guarded split&merge, and two variants of Samplesort. The experiments are performed on 2up to 5-dimensional wrapped butterfly networks with 8 up to 160 processors. We ...
متن کاملSorting on a Massively Parallel System Using a Library of Basic Primitives: Modeling and Experimental Results
We present a comparative study of implementations of the following sorting algorithms on the Parsytec SC320 reconfigurable, asynchronous, massively parallel MIMD machine: Bitonic Sort, Odd-Even Merge Sort, Odd-Even Merge Sort with guarded split&merge, and two variants of Samplesort. The experiments are performed on 2up to 5-dimensional wrapped butterfly networks with 8 up to 160 processors. We ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Inf. Process. Lett.
دوره 61 شماره
صفحات -
تاریخ انتشار 1997